<?php
$OnIdleTimeout1 = 60; # Idle timeout for OnIdleAction1 in seconds
Event OnIdle1( $userName ) # Player event
UserGroupFromFile( "idleExempt", "./idleexempt.txt" );
IF( UserInGroup( "idleExempt",$userName ) == 0 )
THEN
privMsg( langEngine( "%{main_idle1}%" ) );
ENDIF
EndEvent
$OnIdleTimeout2 = 120; # Idle timeout for OnIdleAction2 in seconds
Event OnIdle2( $userName ) # Player event
UserGroupFromFile( "idleExempt", "./idleexempt.txt" );
IF ( UserInGroup( "idleExempt",$userName ) == 0 )
THEN
cmdLFS ( "/spec " . GetCurrentPlayerVar("Nickname") );
privMsg ( langEngine( "%{main_idle2}%" ) );
ENDIF
EndEvent
?>
<?php
Sub pace_control_command( $KeyFlags,$id )
IF (GetLapperVar("ShortTime") >= GetCurrentPlayerVar( "control_commands"))
THEN
$time_splitted = SplitToArray( GetLapperVar("ShortTime"),":" ); #split ShortTime into an array
$time_splitted[1] = $time_splitted[1] + 1; #add one minute to the current minutes
# Check if minutes has value 60 or above. If so, raise hours by one and lower minutes by sixty
IF ($time_splitted[1] >= 60)
THEN
$time_splitted[0] = $time_splitted[0] + 1;
$time_splitted[1] = $time_splitted[1] - 60;
ENDIF
# Check if hours has value 24. If so, reduce hours by 24
IF ($time_splitted[0] == 24)
THEN
$time_splitted[0] = $time_splitted[0] - 24;
ENDIF
# Merge hours and minutes into one value
$pace_control = "" . $time_splitted[0] . ":" . $time_splitted[1];
# Set player var 'control_command' to the new time stamp
# Set player var 'control_command_allowd' to "yes"
SetCurrentPlayerVar( "control_commands", $pace_control );
SetCurrentPlayerVar( "control_commands_allowed", "yes" );
ELSE
# Set player var 'control_command_allowd' to "no"
SetCurrentPlayerVar( "control_commands_allowed", "no" );
ENDIF
EndSub
?>
<?php
CASE "!test":
pace_control_command( 0,0 );
IF (GetCurrentPlayerVar( "control_commands_allowed" ) == "yes" )
THEN
MyTest();
ELSE
PrivMsg("^1You have to wait until it is ^3(" . GetCurrentPlayerVar( "control_commands") . ")^1 , to be able to execute this command");
ENDIF
BREAK;
?>
<?php
IF (GetLapperVar("ShortTime") >= GetCurrentPlayerVar( "control_commands"))
THEN
$time_splitted = SplitToArray( GetLapperVar("ShortTime"),":" ); #split ShortTime into an array
$time_splitted[1] = $time_splitted[1] + 1; #add one minute to the current minutes
# Check if minutes has value 60 or above. If so, raise hours by one and lower minutes by sixty
IF ($time_splitted[1] >= 60)
THEN
$time_splitted[0] = $time_splitted[0] + 1;
$time_splitted[1] = $time_splitted[1] - 60;
ENDIF
# Check if hours has value 24. If so, reduce hours by 24
IF ($time_splitted[0] == 24)
THEN
$time_splitted[0] = $time_splitted[0] - 24;
ENDIF
# Merge hours and minutes into one value
$pace_control_time = "" . $time_splitted[0] . ":" . $time_splitted[1];
# Set player var 'control_command' to the new time stamp
SetCurrentPlayerVar( "control_commands", $pace_control_time );
?>
<?php
ELSE
PrivMsg("^1You have to wait until it is ^3(" . GetCurrentPlayerVar( "control_commands") . ")^1 , to be able to execute a command");
ENDIF
?>